package 数组.easy;

/**
 * @author Lw中
 * @date 2020/8/4 9:36
 */
public class YiLingYiLing {

    public static int numPairsDivisibleBy60(int[] time) {
        for (int i = 0; i < time.length; i++) {
            time[i] = time[i] % 60;
        }
        int num = 0;
        for (int i = 1 ; i < time.length; i++) {
            int j= i - 1;
            for (; j >= 0; --j) {
                if (time[i] + time[j]== 60 || time[i] + time[j] == 0) {
                    num++;
                }
            }
        }
        return num;
    }

    public static void main(String[] args) {
        int[] arr = {21,39, 39,21};
        System.out.println(numPairsDivisibleBy60(arr));
    }

}
